package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.mallbean.Brand;
import com.cskaoyan.service.wx.WxBrandService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.wx.WxBrandDetailVo;
import com.cskaoyan.vo.wx.WxBrandListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: feisl
 * @Date: 2021/5/12 16:37
 */
@RestController
@RequestMapping("wx/brand")
public class WxBrandController {

    @Autowired
    WxBrandService wxBrandService;
    @RequestMapping("list")
    public BaseRespVo list(Integer page, Integer size) {

        WxBrandListVo wxBrandListVO = wxBrandService.list(page, size);

        return BaseRespVo.ok(wxBrandListVO);
    }

    @RequestMapping("detail")
    public BaseRespVo detail(Integer id){

        Brand brand = wxBrandService.detail(id);

        WxBrandDetailVo wxBrandDetailVo = new WxBrandDetailVo();
        wxBrandDetailVo.setBrand(brand);

        return BaseRespVo.ok(wxBrandDetailVo);

    }
}
